****make country groups

gen countrygroup = 1

replace countrygroup = 2 if country == "Albania" | country == "Bulgaria" | country == "Czech Republic" | country == "Estonia" | country == "Hungary" | country == "Lithuania" | country == "Poland" | country == "Slovakia" | country == "Slovenia" | country == "Ukraine"

replace countrygroup = 3 if country == "Cyprus" | country == "Israel" | country == "Italy" | country == "Portugal" | country == "Spain"

label var countrygroup "Country group"

label define countrygroup 1 "Western Europe" 2 "Post-Communist" 3 "Southern Europe", replace

label val countrygroup countrygroup



***Analyis by countrygroup: Expectations

*Liberal

quietly eststo Liberal: xtmixed exp_liberal plinsoc maledummy agea || country:

quietly eststo Liberal1: xtmixed exp_liberal hinctnta eduyrs occ maledummy agea || country:

quietly eststo Liberal2: xtmixed exp_liberal plinsoc maledummy agea comm_country crisis_country age_demo DQ|| country:

*quietly margins, dydx(comm_country) at(plinsoc=(0 (1) 10)) vsquish
*marginsplot, yline(0) title(Expectations liberal: Average marginal effects of post-communist country)

quietly eststo Liberal3: xtmixed exp_liberal plinsoc maledummy agea comm_country crisis_country countrygroup#c.plinsoc  || country: plinsoc
quietly margins, dydx(plinsoc) at(countrygroup=(1 (1) 3)) vsquish
marginsplot, recast(scatter) plot1opts(mcolor(gs3)) ciopt(color(navy)) yline(0) title(Expectations liberal: Average marginal effects of subjective status)

quietly eststo Liberal2: xtmixed exp_liberal plinsoc maledummy agea countrygroup#plinsoc age_demo DQ || country: plinsoc
margins plinsoc#countrygroup
marginsplot, yline(0) title(Expectations liberal: Average marginal effects of subjective status)

quietly eststo Liberal4: xtmixed exp_liberal plinsoc maledummy agea comm_country crisis_country countrygroup#c.plinsoc [pweight = pspwght]|| country: plinsoc 

esttab Liberal Liberal1 Liberal2 Liberal3 Liberal4 using Exp_liberal.rtf, se label aic bic scalars (chi2) star (+ 0.10 * 0.05 ** 0.005 *** 0.001) replace


*Social

quietly eststo Social: xtmixed exp_social plinsoc maledummy agea || country:

quietly eststo Social1: xtmixed exp_social hinctnta eduyrs occ maledummy agea || country:

quietly eststo Social2: xtmixed exp_social plinsoc maledummy agea comm_country crisis_country age_demo DQ solt_gininc solt_ginred || country: 

quietly eststo Social3: xtmixed exp_social plinsoc maledummy agea comm_country crisis_country countrygroup#c.plinsoc  || country: plinsoc

quietly margins, dydx(plinsoc) at(countrygroup=(1 (1) 3)) vsquish
marginsplot, recast(scatter) plot1opts(mcolor(gs3)) ciopt(color(navy)) yline(0) title(Expectations social: Average marginal effects of subjective status)

quietly eststo Social2: xtmixed exp_social plinsoc maledummy agea countrygroup#plinsoc age_demo DQ wdi_gdpc wdi_infl || country: plinsoc
margins plinsoc#countrygroup
marginsplot, yline(0) title(Predicted levels of social expectations in country groups according to subjective status)

quietly eststo Social4: xtmixed exp_social plinsoc maledummy agea comm_country crisis_country countrygroup#c.plinsoc [pweight = pspwght]  || country: plinsoc


esttab Social Social1 Social2 Social3 Social4 using Exp_Social.rtf, se label aic bic scalars (chi2) star (+ 0.10 * 0.05 ** 0.005 *** 0.001) replace


*Direct

quietly eststo Direct: xtmixed exp_direct plinsoc maledummy agea || country:

quietly eststo Direct1: xtmixed exp_direct hinctnta eduyrs occ maledummy agea || country:

quietly eststo Direct2: xtmixed exp_direct plinsoc maledummy agea comm_country crisis_country age_demo DQ || country: plinsoc

quietly eststo Direct3: xtmixed exp_direct plinsoc maledummy agea comm_country crisis_country countrygroup#c.plinsoc || country: plinsoc

quietly eststo Direct4: xtmixed exp_direct plinsoc maledummy agea comm_country crisis_country countrygroup#c.plinsoc [pweight = pspwght] || country: plinsoc

esttab Direct Direct1 Direct2 Direct3 Direct4 using Exp_Direct.rtf, se label aic bic scalars (chi2) star (+ 0.10 * 0.05 ** 0.005 *** 0.001) replace


coefplot Liberal Liberal1 Social Social1, drop (_cons) xline(0) byopts(xrescale) norecycle legend(rows(1))

coefplot Liberal Liberal1 Social Social1, drop (_cons) xline(0)

coefplot Liberal2 Liberal3 Social2 Social3, drop (_cons maledummy agea) xline(0)


***Analyis by countrygroup: Evaluations


*Liberal

quietly eststo Liberal1: xtmixed ev_liberal plinsoc maledummy agea || country:

quietly eststo Liberal11: xtmixed ev_liberal hinctnta eduyrs occ maledummy agea || country:

quietly eststo Liberal12: xtmixed ev_liberal plinsoc maledummy agea comm_country crisis_country age_demo DQ  || country:

quietly eststo Liberal13: xtmixed ev_liberal plinsoc maledummy agea comm_country crisis_country countrygroup#c.plinsoc || country: plinsoc

quietly margins, dydx(plinsoc) at(countrygroup=(1 (1) 3)) vsquish
marginsplot, recast(scatter) plot1opts(mcolor(gs3)) ciopt(color(navy)) yline(0) title(Evaluations liberal: Average marginal effects of subjective status)

quietly eststo Liberal12: xtmixed ev_liberal plinsoc maledummy agea countrygroup#plinsoc age_demo DQ || country: plinsoc

margins plinsoc#countrygroup
marginsplot, yline(0) title(Predicted levels of liberal evaluations in country groups according to subjective status)

quietly eststo Liberal114: xtmixed ev_liberal plinsoc maledummy agea comm_country crisis_country countrygroup#c.plinsoc [pweight = pspwght] || country: plinsoc

esttab Liberal1 Liberal11 Liberal12 Liberal13 Liberal114 using ev_liberal.rtf, se label aic bic scalars (chi2) star (+ 0.10 * 0.05 ** 0.005 *** 0.001) replace

*Social

quietly eststo Social1: xtmixed ev_social plinsoc maledummy agea || country:

quietly eststo Social11: xtmixed ev_social hinctnta eduyrs occ maledummy agea || country:

quietly eststo Social12: xtmixed ev_social plinsoc maledummy agea comm_country crisis_country age_demo DQ solt_gininc solt_ginred || country:

quietly eststo Social13: xtmixed ev_social plinsoc maledummy agea comm_country crisis_country countrygroup#c.plinsoc  || country: plinsoc

quietly margins, dydx(plinsoc) at(countrygroup=(1 (1) 3)) vsquish
marginsplot, recast(scatter) plot1opts(mcolor(gs3)) ciopt(color(navy)) yline(0) title(Evaluations Social: Average marginal effects of subjective status)

quietly eststo Social12: xtmixed ev_social plinsoc maledummy agea countrygroup#plinsoc  || country: plinsoc
margins plinsoc#countrygroup
marginsplot, yline(0) title(Predicted levels of social evaluations in country groups according to subjective status)

quietly eststo Social14: xtmixed ev_social plinsoc maledummy agea comm_country crisis_country countrygroup#c.plinsoc [pweight = pspwght] || country: plinsoc

esttab Social1 Social11 Social12 Social13 Social14 using ev_Social.rtf, se label aic bic scalars (chi2) star (+ 0.10 * 0.05 ** 0.005 *** 0.001) replace

coefplot Liberal12 Liberal13 Social12 Social13, drop (_cons maledummy agea) xline(0)


*Direct

quietly eststo Direct1: xtmixed ev_direct plinsoc maledummy agea || country:

quietly eststo Direct11: xtmixed ev_direct hinctnta eduyrs occ maledummy agea || country:

quietly eststo Direct12: xtmixed ev_direct plinsoc maledummy agea comm_country crisis_country age_demo DQ || country:

quietly eststo Direct13: xtmixed ev_direct plinsoc maledummy agea comm_country crisis_country countrygroup#c.plinsoc || country: plinsoc

quietly eststo Direct14: xtmixed ev_direct plinsoc maledummy agea comm_country crisis_country countrygroup#c.plinsoc [pweight = pspwght] || country: plinsoc

esttab Direct1 Direct11 Direct12 Direct13 Direct14 using ev_Direct.rtf, se label aic bic scalars (chi2) star (+ 0.10 * 0.05 ** 0.005 *** 0.001) replace


coefplot Liberal1 Liberal11 Social1 Social11, drop (_cons) xline(0) byopts(xrescale) norecycle legend(rows(1))

coefplot Liberal1 Liberal11 Social1 Social11, drop (_cons) xline(0)






